<template>
  <v-app>
    <Topbar @onConfirmBtnClick="saveDistInfo" />
    <v-content>
      <v-distpicker type="mobile" @selected="onSelected"></v-distpicker>
    </v-content>
  </v-app>
</template>

<script>
import Topbar from './components/Topbar.vue';

export default {
  components: { Topbar },
  data() {
    return {
      dist: {
        province: '',
        city: '',
        region: ''
      }
    };
  },
  methods: {
    saveDistInfo() {
      this.$store.commit('saveCurrDistInfo', this.dist);
      this.$router.go(-1);
    },
    onSelected(dist) {
      this.dist.province = dist.province.value;
      this.dist.city = dist.city.value;
      this.dist.region = dist.area.value;
    }
  }
};
</script>
